<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf8"><LINK 
href="showAllOrg.files/style.htm" rel=stylesheet><LINK 
href="showAllOrg.files/content.htm" rel=stylesheet>

		<script type="text/javascript">
		    var djConfig = {
				isDebug:true,
				parseOnLoad:true,
				usePlainJson:true
		    };
		</script>
		 
		<script type="text/javascript" src="dojo/dojo/dojo.js"></script>
		<script type="text/javascript" src="dojo/dijit/dijit.js"></script>

		<script type="text/javascript">
    		dojo.require("dijit.form.Button");
    		dojo.require("dojo.rpc.JsonService");    	
    	</script>
    	<script language="JavaScript" type="text/javascript">
    		var orderBoxService = new dojo.rpc.JsonService("box/order/OrderBoxService?smd");
    		var orderPlanImportService = new dojo.rpc.JsonService("box/alloc/OrderPlanImportService?smd");
			var makeBoxAllocFormService = new dojo.rpc.JsonService("box/alloc/MakeBoxAllocFormService?smd");
			var trackWorkFlowService = new dojo.rpc.JsonService("TrackWorkFlowService?smd");
			var makeShipperNoteService = new dojo.rpc.JsonService("box/order/MakeShipperNoteService?smd");
			
    		//页面加载时的一些操作
			dojo.addOnLoad(load);
			function load() {
				initPage();
			}
			function initPage() {
				var statusName = ["", "等待回应", "未制十联单", "已制十联单", "订舱成功", "做箱中", "完成做箱", "报关成功", "集港", "完船"];
				trackWorkFlowService.queryAllocDetails("", -1, "", "", "").addCallback(function (adList) {					
					console.dir(adList);
					var ad = adList.list;
					for (var i in ad) {
						makeShipperNoteService.getShipperNoteByAdId(ad[i].id).addCallback(function (sn) {
							orderPlanImportService.getOrderPlan(ad[i].BAFID).addCallback(function (orderPlan) {
								console.dir(orderPlan);
								var text = "";

								text = text + "<td align='center'>";
								if (ad[i].commission.commitedService.declare == true) {
									text = text + "<a href='javascript:declare(" + orderPlan.ID + ", " + ad[i].id + ")'><img src='showAllOrg.files/cus.gif' border='0'/></a>";
								}
								if (ad[i].status == 5 || ad[i].status == 6) {
									text = text + "<a href='javascript:update_cl(" + orderPlan.ID + ", " + ad[i].id + ")'><img src='showAllOrg.files/edit.gif' border='0'/></a>";
								} else {
									text = text + "<a href='javascript:alert(\"nothing\")'><img src='showAllOrg.files/view.gif' border='0'/></a>";
								}
								text = text + "</td>";
								
								text = text + "<td align='left'>" + statusName[ad[i].status] + "</td>";
								text = text + "<td align='left'>" + sn.initDateString + "</td>";
								text = text + "<td align='left'>" + ad[i].commission.id + "</td>";
								text = text + "<td align='left'>" + ad[i].commission.sender.name + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.shipComInfo.shortTitle + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.name + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.id + "</td>";
								text = text + "<td align='left'>" + parseInt(ad[i].bigNum + ad[i].smallNum) + "</td>";
								
								//text = text + "</tr>";

								var tr = document.createElement("tr");
								tr.className = "gridtreven";
								document.getElementById("resultTable").tBodies[0].appendChild(tr);
								tr.innerHTML = text;
							});
						});
					}
				});
			}
			function thisQuery() {
				var rows = document.getElementById("resultTable").tBodies[0].rows;
				for (var i = rows.length - 1; i > 0; i--) {
					var rIndex = rows[i].sectionRowIndex;
					rows[i].parentNode.deleteRow(rIndex);
				}

				var statusName = ["", "等待回应", "未制十联单", "已制十联单", "订舱成功", "做箱中", "完成做箱", "报关成功", "集港", "完船"];
				trackWorkFlowService.queryAllocDetails(document.getElementById("commId").value,
						-1,
						document.getElementById("senderName").value,
						document.getElementById("shipComName").value,
						document.getElementById("scdId").value).addCallback(function (adList) {					
					console.dir(adList);
					var ad = adList.list;
					for (var i in ad) {
						makeShipperNoteService.getShipperNoteByAdId(ad[i].id).addCallback(function (sn) {
							orderPlanImportService.getOrderPlan(ad[i].BAFID).addCallback(function (orderPlan) {
								console.dir(orderPlan);
								if (document.getElementById("date").value == sn.initDate &&
										document.getElementById("adStatus").value == statusName[ad[i].status]) {
									var text = "";
									
									text = text + "<td align='center'>";
									if (ad[i].commission.commitedService.declare == true) {
										text = text + "<a href='javascript:declare(" + orderPlan.ID + ", " + ad[i].id + ")'><img src='showAllOrg.files/cus.gif' border='0'/></a>";
									}
									if (ad[i].status == 5 || ad[i].status == 6) {
										text = text + "<a href='javascript:update_cl(" + orderPlan.ID + ", " + ad[i].id + ")'><img src='showAllOrg.files/edit.gif' border='0'/></a>";
									} else {
										text = text + "<a href='javascript:alert(\"nothing\")'><img src='showAllOrg.files/view.gif' border='0'/></a>";
									}
									text = text + "</td>";
									
									text = text + "<td align='left'>" + statusName[ad[i].status] + "</td>";
									text = text + "<td align='left'>" + sn.initDateString + "</td>";
									text = text + "<td align='left'>" + ad[i].commission.id + "</td>";
									text = text + "<td align='left'>" + ad[i].commission.sender.name + "</td>";
									text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.shipComInfo.shortTitle + "</td>";
									text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.name + "</td>";
									text = text + "<td align='left'>" + orderPlan.shipSchedule.id + "</td>";
									text = text + "<td align='left'>" + parseInt(ad[i].bigNum + ad[i].smallNum) + "</td>";
		
									var tr = document.createElement("tr");
									tr.className = "gridtreven";
									document.getElementById("resultTable").tBodies[0].appendChild(tr);
									tr.innerHTML = text;
								}
							});
						});
					}
				});
			}
			function thisReset() {
				document.getElementById("commId").value = "";
				document.getElementById("adStatus").value = "";
				document.getElementById("senderName").value = "";
				document.getElementById("date").value = "";
				document.getElementById("shipComName").value = "";
				document.getElementById("scdId").value = "";
			}
			//更新装箱单
			function update_cl(orderPlanID, adId) {
				makeBoxAllocFormService.setBookBoxParams(orderPlanID.toString(), adId).addCallback(function () {
					//alert(orderPlanID);
					//alert(adId);
					window.open("更新装箱单.htm", "_self");
				});
			}
			//报关
			function declare(orderPlanID, adId) {
				makeBoxAllocFormService.setBookBoxParams(orderPlanID.toString(), adId).addCallback(function () {
					window.open("报关管理明细.htm", "_self");
				});
			}
    	</script>
<script language="javascript">
function zxd(){
  var m_url = "装箱单列表.htm";
  var ppp = window.open(m_url,"","top=30,left=50,width=800,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1");
  ppp.focus();
}

function dcwt(){
  var m_url = "订舱委托单明细.htm";
  var ppp = window.open(m_url,"","top=30,left=50,width=800,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1");
  ppp.focus();
}
function sld(){
  var m_url = "十联单（一联）明细.htm";
  var ppp = window.open(m_url,"","top=30,left=50,width=800,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1");
  ppp.focus();
}

function cgstd(){
  var m_url = "船公司提单明细.htm";
  var ppp = window.open(m_url,"","top=30,left=50,width=800,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1");
  ppp.focus();
}
</script>

<title>业务流程跟踪管理</title>

</HEAD>

<BODY><FONT style="FONT-SIZE: 18px" face=隶书 color=#3656b9 
;>业务流程跟踪管理</FONT><BR><IMG src="showAllOrg.files/line2.gif"><BR>


<CENTER><!--查询操作表格-->
<TABLE cellSpacing=0 cellPadding=0 width=560 align=center border=0>
  <TBODY>
  <TR>
    <TD align=right><FONT class=redcolor face=Webdings>4</FONT><A 
      href="javascript:thisQuery()">查询</A>&nbsp;&nbsp; <FONT class=redcolor 
      face=Webdings>4</FONT><A href="javascript:thisReset()">重置</A> 
  </TD></TR></TBODY></TABLE><!--数据区form-->
<FORM name=formHidden action=/cerp/showAllOrg method=post><INPUT type=hidden 
value=1 name=currentPage> <INPUT type=hidden value=1 name=pageCount> <INPUT 
type=hidden value=query name=opFlag> <INPUT type=hidden name=query_orgID0> 
<INPUT type=hidden name=currentRow> <!--查询条件表格，规定样式为class="queryarea"，注意框架的内容显示区规定了表格的最大width不得超过760，按排版需要可小于760。-->
<TABLE class=queryarea cellSpacing=2 cellPadding=2 width=600 align=center>
  <TBODY>
  <TR>
    <TD class=rtitle>订舱委托单编号:</TD>
    <TD class=ltitle><INPUT id="commId" class=linput 
      name=query_orgID> 
    <TD class=rtitle>状态:</TD>
    <TD class=ltitle><INPUT id="adStatus" class=linput 
      name=query_orgName> </TD>
  <TR>
    <TD class=rtitle>订舱日期:</TD>
    <TD class=ltitle><INPUT id="date" class=linput
      name=query_type> 
    <TD class=rtitle>顾客名称:</TD>
    <TD class=ltitle><INPUT id="senderName" class=linput
      name=query_father> </TD></TR>
   <TR>
    <TD class=rtitle>船公司:</TD>
    <TD class=ltitle><INPUT id="shipComName" class=linput
      name=query_type> 
    <TD class=rtitle>船次:</TD>
    <TD class=ltitle><INPUT id="scdId" class=linput
      name=query_father> </TD></TR>
  </TBODY></TABLE><BR><!--数据显示区表格，规定样式为class="gridarea" -->
<TABLE id="resultTable" class=gridarea cellSpacing=1 cellPadding=2 width=660 align=center><!--数据行标题-->
  <TBODY>
  <TR>
    <TD class=gridtitletd vAlign="middle" width=83>操作 </TD>
    <TD class=gridtitletd vAlign="middle" width=60>状态</TD>
    <TD class=gridtitletd vAlign="middle" width=76>订舱日期</TD>
    <TD class=gridtitletd vAlign="middle" width=87>订舱委托单编号</TD>
    <TD class=gridtitletd vAlign="middle" width=63>顾客名</TD>
    <TD class=gridtitletd vAlign="middle" width=70>船公司名</TD>
    <TD class=gridtitletd vAlign="middle" width=76>船舶名称</TD>
    <TD class=gridtitletd vAlign="middle" width=47>船次</TD>
    <TD class=gridtitletd vAlign="middle" width=45>箱数</TD>
	
	</TR>
  
  <!--数据行内容，样式规定为gridtrodd、gridtreven交替出现，即灰白行交替出现--><!--注意数据行中的input命名规则，一般以对应数据库字段名＋实际序号表示，在JAVA程序中取值时，亦使用同一规则。-->
  <!--数据新增行，如果有这一行，表示可在此页面中录入数据；--></TBODY></TABLE>
</FORM><!--简单表翻页脚标。-->
<TABLE height=30 cellSpacing=0 cellPadding=0 width=660 align=center border=0>

  <TBODY>
  <TR>
    <TD align=left width=660><A href="javascript:%20firstPage()"><IMG 
      height=15 src="showAllOrg.files/first.gif" width=20 border=0></A><A 
      href="javascript:%20prevPage()"><IMG height=15 
      src="showAllOrg.files/first1.gif" width=20 border=0></A> <INPUT 
      class=linput onkeypress="return locate(this);" size=3 value=1> <A 
      href="javascript:%20nextPage()"><IMG height=15 
      src="showAllOrg.files/last1.gif" width=20 border=0></A><A 
      href="javascript:%20lastPage()"><IMG height=15 
      src="showAllOrg.files/last.gif" width=20 border=0></A>&nbsp; 第1页/共1页 
  </TD></TR></TBODY></TABLE>
<SCRIPT language=javascript>
function nextPage() {
  return;
}
function prevPage() {
  return;
}
function firstPage() {
  return;
}
function lastPage() {
  return;
}
//直接定位时调用
function locate(obj) 
{
  var tmpChar = window.event.keyCode;
  if (tmpChar == 13) 
  {
    var val = parseInt(obj.value);
    if (val>1 || val<1 || isNaN(val))  
    {
      alert("要查询的页面不存在!: " + obj.value);
      obj.value=1;
      return false;
    }
    document.formHidden.currentPage.value= val;
    document.formHidden.submit();
    return false;
  }
  else
  {
     if (tmpChar>47 && tmpChar<58) 
     {  
         return true;
     }  
     return false; 
  }  
}  
</SCRIPT>
</CENTER></BODY></HTML>
